import request from '@/utils/request'

export function getRoleList(page, pagesize) {
  return request({
    method: 'GET',
    url: '/sys/role',
    params: {
      page,
      pagesize
    }
  })
}

// 添加角色
export function addRoleInfo(data) {
  return request({
    method: 'POST',
    url: '/sys/role',
    data
  })
}

// 删除角色
export function delRoleInfo(id) {
  return request({
    method: 'DELETE',
    url: `/sys/role/${id}`
  })
}

// 修改角色
export function editRoleInfo(id, data) {
  return request({
    method: 'PUT',
    url: `/sys/role/${id}`,
    data
  })
}

// 获取角色详情
export function getRoleInfo(id) {
  return request({
    method: 'GET',
    url: `/sys/role/${id}`
  })
}
